Skip to content

Migrate from VuePress to VitePress with enhancements and fixes#7

Merged
realDuang merged 13 commits intomainfrom
copilot-worktree-2026-03-01T08-40-29
Mar 1, 2026
Merged

Migrate from VuePress to VitePress with enhancements and fixes#7
realDuang merged 13 commits intomainfrom
copilot-worktree-2026-03-01T08-40-29

Conversation

@realDuang
Copy link
Copy Markdown
Owner

This pull request migrates the documentation system from VuePress 1.x to VitePress, modernizing the docs, build process, and deployment workflow. The migration includes replacing configuration files, updating scripts and dependencies, customizing the theme, and improving sidebar generation. Several related code and workflow updates are also included.

Migration from VuePress to VitePress:

  • Removed all VuePress-specific files and dependencies, including vuepress, vuepress-bar, and the old config in docs/.vuepress/config.ts. Added new VitePress dependencies and configuration files (vitepress, docs/.vitepress/config.mts, docs/.vitepress/sidebar.ts, docs/.vitepress/theme/index.ts, and docs/.vitepress/theme/custom.css). [1] [2] [3] [4] [5] [6] [7] [8]

  • Updated documentation entry point: replaced the old docs/README.md (VuePress home) with a new docs/index.md using VitePress frontmatter and home layout, including a new hero section and feature descriptions. [1] [2]

Build, Deployment, and Linting Updates:

  • Updated the GitHub Actions workflow to use the main branch, upgraded actions to latest versions, switched to Node.js 20, and changed the build and deploy steps to use VitePress output (docs/.vitepress/dist). Added concurrency control to deployments.

  • Updated npm scripts to use VitePress commands for development, build, and preview. Adjusted lint scripts to include new config and sidebar files.

  • Updated .prettierignore and ESLint config to ignore new VitePress build/cache folders. [1] [2]

Sidebar and Theme Improvements:

  • Replaced sidebar generation logic: removed the old bar-based system and added a new TypeScript-based sidebar generator for VitePress, supporting category titles and markdown heading extraction for sidebar display.

  • Added a custom theme for VitePress to match the previous VuePress green theme and improved the homepage layout and table styles. [1] [2]

Minor Documentation Improvements:

  • Clarified and improved code examples in the tree traversal topic, refining variable names and comments. [1] [2]

VuePress → VitePress migration:

  • Removed VuePress config and dependencies, added VitePress config, sidebar, and theme files. [1] [2] [3] [4] [5] [6] [7] [8]
  • Replaced docs/README.md with a new VitePress docs/index.md home page. [1] [2]

Build and deployment updates:

  • Updated GitHub Actions workflow and npm scripts for VitePress, Node.js 20, and improved deployment concurrency. [1] [2]
  • Updated lint and ignore configs for new VitePress folders. [1] [2]

Sidebar and theme improvements:

  • Added a new TypeScript sidebar generator with improved category titles and markdown heading extraction.
  • Added a custom VitePress theme for consistent branding and improved homepage/table styles. [1] [2]

Documentation improvements:

  • Improved clarity and correctness in tree traversal code examples. [1] [2]

realDuang and others added 13 commits March 1, 2026 17:37
- Replace VuePress 1.x with VitePress 1.6
- Create custom sidebar generator to replace vuepress-bar plugin
- Update homepage frontmatter to VitePress format
- Optimize GitHub Actions workflow (pnpm cache, concurrency, frozen-lockfile)
- Switch CI trigger branch from master to main
- Update .gitignore, .prettierignore and eslint config for VitePress

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix sidebar: extract Chinese titles from markdown headings instead of filenames
- Fix homepage 404: rename README.md to index.md for VitePress compatibility
- Fix theme: override brand colors to match VuePress green theme (#3eaf7c)
- Fix outline: configure heading extraction for chapter navigation
- Enhance homepage: add hero section, feature cards, topic index and category stats
- Update site title to 'LeetCode 通关手册'
- Add ci.yml: lint, typecheck, format check, and test on push/PR
- Refactor main.yml: use actions/deploy-pages instead of third-party action
- Declare minimal permissions for both workflows
- Use node-version-file instead of hardcoded version
…ion body

- Export deserialize and serialize functions from src/utils/tree.ts
- Add placeholder return in 815.公交路线.ts to fix missing return error
- Revert serialize/deserialize exports (they are internal to tree.ts)
- Remove unnecessary import in 199.二叉树的右视图.ts, use global Tree.deserialize
- Run prettier on all 232 unformatted files to pass format:check
- Add preview.yml workflow for Netlify deploy previews on PRs
The glob 'src/**/*.{js,ts}' matches .d.ts files on Linux but not
on Windows, causing CI-only lint failures for no-explicit-any in
global-utils.d.ts. Adding '**/*.d.ts' to ESLint ignores resolves
the cross-platform inconsistency.
- Add .gitattributes forcing LF for all text files
- Re-normalize 80 files from CRLF to LF in git index
@realDuang realDuang merged commit 6b8b071 into main Mar 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant